<template>
    <j-modal
            :width="1200"
            :visible="visible"
            :maskClosable="false"
            fullscreen
            @ok="handleOk"
            @cancel="handleCancel"
    >
        <msi-server-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"/>
        <!--      <template slot="footer">
                  <a-button @click="handleCancel">关闭</a-button>
                  &lt;!&ndash; <a-button @click="handleOks"  type="primary"> 确定</a-button> &ndash;&gt;
              </template>-->
    </j-modal>

</template>

<script>

    import MsiServerForm from './MsiServerForm'

    export default {
        name: 'MsiServerModal',
        components: {
            MsiServerForm
        },
        data() {
            return {
                title: '',
                visible: false,
                disableSubmit: false
            }
        },
        methods: {
            add() {
                this.visible = true
                this.$nextTick(() => {
                    this.$refs.realForm.add()
                })
            },
            edit(record) {
                this.visible = true
                this.$nextTick(() => {
                    this.$refs.realForm.edit(record)
                })
            },
            close() {
                this.$emit('close')
                this.visible = false
            },
            handleOk() {
                this.$refs.realForm.submitForm()
            },
            submitCallback() {
                this.$emit('ok')
                this.visible = false
            },
            handleCancel() {
                this.close()
            }
        }
    }
</script>

<style scoped>
</style>
